{extend name="public/common"}

{block name="style"}
<title>点对点教育VIP学员_每日统计</title>
<link rel="stylesheet" href="__HOME__/css/mui/mui.min.css">
<link rel="stylesheet" href="__HOME__/css/test/mui.picker.min.css">
<link rel="stylesheet" href="__HOME__/css/test/school.css">
<style>
    .top {
        width: 100%;
        font-size: 3rem;
        color: #64a052;
        margin: 4vw auto 2vw 2vw;
    }
    .top span {
        font-size: 15px;
        margin-top: 1.8vw;
        color: #F9CB79;
        float: right;
        margin-left: -15vw;
    }
    .top img {
        width: 32px;
        margin-top: -8px;
        margin-right: 2vw;
    }
    .sweet-alert h2 {
        color: #847d7d8f;
        font-size: 27px;
    }
    .list ul li {
        border-bottom: 1px solid #f1f1f1;
        font-size: 1.8rem;
        padding: 4vw 3.2vw 4vw 2.2vw;
        overflow: hidden;
        vertical-align: middle;
    }
    .mui-table-view-cell>a:not(.mui-btn) {
        font-size: 1.36rem;
        margin: 2vw;
        text-align: center;
        white-space: pre-wrap;
    }
    .mui-popover .mui-table-view{
        text-align: center;
    }
    #openPopover {
        color: #F9CB79;
        font-size: 2.2rem;
        width: 50%;
        float: right;
        text-align: left;
    }
    #openPopover1,#openPopover10,#openPopover11{
        color: #F9CB79;
        font-size: 2.2rem;
        width: 50%;
        float: right;
        text-align: left;
    }
    #openPopover2,#openPopover3,#openPopover6{
        color: #F9CB79;
        font-size: 2.2rem;
        width: 55%;
        float: right;
        text-align: left;
    }
    #openPopover9{
        color: #F9CB79;
        font-size: 2.2rem;
        width: 47%;
        float: right;
        text-align: left;
    }
    #openPopover8,#openPopover4,#openPopover7{
        color: #F9CB79;
        font-size: 2.2rem;
        width: 50%;
        float: right;
        text-align: left;
    }
    .list ul li input[type="text"],input[type="number"] {
        border: none;
        margin-bottom: 0;
        width: 65%;
        text-align: left;
        right: 0;
        padding: 0;
        -webkit-user-select: text;
        -user-select: text;
    }
    .time p{
        display: inline-block;
        content: '';
        width: 0;
        height: 0;
        border-left: 0.6rem solid transparent;
        border-right: 0.6rem solid transparent;
        border-top: 0.8rem solid #949494;
        margin-right: 7rem;
        position: relative;
        top:1.4rem;
        float:right;
    }
</style>
{/block}

{block name="body"}
<div class="top">
    <img src="__HOME__/images/sign/paper.png">
    每 日 统 计
    <span>（昨9：00—今9:00）</span>
</div>
<div class="main">
    <div class="list">
        <ul>
            <li class="type1 time" style="padding-top: 0;padding-bottom: 2vw;border-bottom: 4px solid #f1f1f1;">
                <input type="text" style="font-size: 22px;width:60%;text-align: right;color: #64a052;" name="time" value="" id="date" readonly>
                <p></p>
            </li>
            <li class="type1 address">
                已关注（总）：
                <span id="openPopover" href=""><p>0</p></span>
            </li>
            <li class="type1 address">
                已认证（总）：
                <span id="openPopover1" href=""><p>0</p></span>
            </li>
            <li class="type1 address">
                已认证（生）：
                <span id="openPopover10" href="" ><p>0</p></span>
            </li>
            <li class="type1 address">
                已认证（师）：
                <span id="openPopover11" href="" ><p>0</p></span>
            </li>
            <li class="type1 address">
                签到（生）：
                <span id="openPopover2" href="" ><p>0</p></span>
            </li>
            <li class="type1 address">
                总结（生）：
                <span id="openPopover3" href="" ><p>0</p></span>
            </li>
            <li class="type1 address">
                作业（生）：
                <span id="openPopover6" href="" ><p>0</p></span>
            </li>
            <li class="type1 address">
                总结批阅（师）：
                <span id="openPopover7" href="" ><p>0</p></span>
            </li>
            <li class="type1 address">
                作业批阅（师）：
                <span id="openPopover4" href="" ><p>0</p></span>
            </li>
            <li class="type1 address">
                上课签到（生）：
                <span id="openPopover8" href="" ><p>0</p></span>
            </li>
            <li class="type1 address">
                课后评价（生）：
                <span id="openPopover9" href="" ><p>0</p></span>
            </li>
        </ul>
    </div>
</div>
<div class="showbox">
    <div class="loader">
        <svg class="circular" viewBox="25 25 50 50">
            <circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10"/>
        </svg>
    </div>
</div>
{/block}

{block name="script"}
<script src="__HOME__/js/reset.js"></script>
<script src="__HOME__/js/mui.min.js"></script>
<script src="__HOME__/js/mui.picker.min.js"></script>
<script src="__HOME__/js/jquery-1.12.1.min.js"></script>
<script>
    $('title' ).text('点对点教育VIP学员_每日统计');
    mui('.mui-scroll-wrapper').scroll();
    var time = "{$time}";
    if (localStorage.getItem("time") !="" && localStorage.getItem("time") !=null){
        time = localStorage.getItem("time");
    }
    $("input[name='time']").val(time);
    $(".showbox").hide();
    $.ajax({
        type:"post",
        url: "{:Url('Paper/select')}",
        data:{
            'time':time
        },
        beforeSend: function(XMLHttpRequest){
            $(".showbox").show();
        },
        success:function(data){
            $(".showbox").hide();
            var href1 = "/DDDeducation/public/index.php/home/Paper/rank/type/1/time/"+time;  // 签到
            var href2 = "/DDDeducation/public/index.php/home/Paper/rank/type/2/time/"+time;  // 总结
            var href3 = "/DDDeducation/public/index.php/home/Paper/rank/type/3/time/"+time;  // 作业
            var href4 = "/DDDeducation/public/index.php/home/Paper/ranks/type/1/time/"+time;  // 总结批阅
            var href5 = "/DDDeducation/public/index.php/home/Paper/ranks/type/2/time/"+time;  // 作业批阅
            if(data.code == 1){
                var msg = data.data;
                $("#openPopover").html(msg.sub_sum+" 人 &emsp;"+msg.sub_sum_flag);
                $("#openPopover1").html(msg.reg_sum+" 人 &emsp;"+msg.reg_sum_flag);
                $("#openPopover10").html(msg.reg_stu+" 人 &emsp;"+msg.reg_stu_flag);
                $("#openPopover11").html(msg.reg_tea+" 人 &emsp;"+msg.reg_tea_flag);
                $("#openPopover2").html(msg.sign_sum+" 人 &emsp;"+msg.sign_sum_flag+"&emsp;<a  href="+href1+" style='font-size: 1.6rem;color: #64a052;float:right;right: 2vw'>详 >></a>");
                $("#openPopover3").html(msg.journal_sum+" 人 &emsp;"+msg.journal_sum_flag+"&emsp;<a  href="+href2+" style='font-size: 1.6rem;color: #64a052;float:right;right: 2vw'>详 >></a>");
                $("#openPopover6").html(msg.homework_sum+" 人 &emsp;"+msg.homework_sum_flag+"&emsp;<a  href="+href3+" style='font-size: 1.6rem;color: #64a052;float:right;right: 2vw'>详 >></a>");
                $("#openPopover7").html(msg.play_sum+" 人 &emsp;"+msg.play_sum_flag+"&emsp;<a  href="+href4+" style='font-size: 1.6rem;color: #64a052;float:right;right: 2vw'>详 >></a>");
                $("#openPopover4").html(msg.plays_sum+" 人 &emsp;"+msg.plays_sum_flag+"&emsp;<a  href="+href5+" style='font-size: 1.6rem;color: #64a052;float:right;right: 2vw'>详 >></a>");
                $("#openPopover8").html(msg.course_sum+" 人 &emsp;"+msg.course_sum_flag);
                $("#openPopover9").html(msg.evaluate_sum+" 人 &emsp;"+msg.evaluate_sum_flag);
            }else{
                swal({
                    title: ' ',
                    text: data.msg,
                    type: 'error',
                    showConfirmButton:false,
                    timer:2000
                });
            }
        }
    });
    //关闭分享
    function onBridgeReady() {
        WeixinJSBridge.call('hideOptionMenu');
    }
    if (typeof WeixinJSBridge == "undefined") {
        if (document.addEventListener) {
            document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
        } else if (document.attachEvent) {
            document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
            document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
        }
    } else {
        onBridgeReady();
    }
    options = {
        scrollY: true, //是否竖向滚动
        scrollX: false, //是否横向滚动
        startX: 0, //初始化时滚动至x
        startY: 0, //初始化时滚动至y
        indicators: false, //是否显示滚动条
        deceleration:0.0006, //阻尼系数,系数越小滑动越灵敏
        bounce: true //是否启用回弹
    };

    mui('.mui-scroll-wrapper').scroll({
        deceleration: 0.0005 //flick 减速系数，系数越大，滚动速度越慢，滚动距离越小，默认值0.0006
    });
    options = {
        scrollY: true, //是否竖向滚动
        scrollX: false, //是否横向滚动
        startX: 0, //初始化时滚动至x
        startY: 0, //初始化时滚动至y
        indicators: false, //是否显示滚动条
        deceleration:0.0006, //阻尼系数,系数越小滑动越灵敏
        bounce: true //是否启用回弹
    };

    mui('.mui-scroll-wrapper').scroll({
        deceleration: 0.0005 //flick 减速系数，系数越大，滚动速度越慢，滚动距离越小，默认值0.0006
    });
    var dtpicker = new mui.DtPicker({
        "type": "date",
        "value": ""
    });
    document.querySelector('.time').addEventListener('tap', function () {
        dtpicker.show(function (e){
            $.ajax({
                type:"post",
                url: "{:Url('Paper/select')}",
                data:{
                    'time':e.text
                },
                beforeSend: function(XMLHttpRequest){
                    $(".showbox").show();
                },
                success:function(data){
                    $(".showbox").hide();
                    var href1 = "/DDDeducation/public/index.php/home/Paper/rank/type/1/time/"+e.text;  // 签到
                    var href2 = "/DDDeducation/public/index.php/home/Paper/rank/type/2/time/"+e.text;  // 总结
                    var href3 = "/DDDeducation/public/index.php/home/Paper/rank/type/3/time/"+e.text;  // 作业
                    var href4 = "/DDDeducation/public/index.php/home/Paper/ranks/type/1/time/"+e.text;  // 总结批阅
                    var href5 = "/DDDeducation/public/index.php/home/Paper/ranks/type/2/time/"+e.text;  // 作业批阅
                    if(data.code == 1){
                        // 数据替换
                        localStorage.setItem("time",e.text);
                        document.getElementById('date').value = e.text;
                        var msg = data.data;
                        $("#openPopover").html(msg.sub_sum+" 人 &emsp;"+msg.sub_sum_flag);
                        $("#openPopover1").html(msg.reg_sum+" 人 &emsp;"+msg.reg_sum_flag);
                        $("#openPopover10").html(msg.reg_stu+" 人 &emsp;"+msg.reg_stu_flag);
                        $("#openPopover11").html(msg.reg_tea+" 人 &emsp;"+msg.reg_tea_flag);
                        $("#openPopover2").html(msg.sign_sum+" 人 &emsp;"+msg.sign_sum_flag+"&emsp;<a  href="+href1+" style='font-size: 1.6rem;color: #64a052;float:right;right: 2vw'>详 >></a>");
                        $("#openPopover3").html(msg.journal_sum+" 人 &emsp;"+msg.journal_sum_flag+"&emsp;<a  href="+href2+" style='font-size: 1.6rem;color: #64a052;float:right;right: 2vw'>详 >></a>");
                        $("#openPopover6").html(msg.homework_sum+" 人 &emsp;"+msg.homework_sum_flag+"&emsp;<a  href="+href3+" style='font-size: 1.6rem;color: #64a052;float:right;right: 2vw'>详 >></a>");
                        $("#openPopover7").html(msg.play_sum+" 人 &emsp;"+msg.play_sum_flag+"&emsp;<a  href="+href4+" style='font-size: 1.6rem;color: #64a052;float:right;right: 2vw'>详 >></a>");
                        $("#openPopover4").html(msg.plays_sum+" 人 &emsp;"+msg.plays_sum_flag+"&emsp;<a  href="+href5+" style='font-size: 1.6rem;color: #64a052;float:right;right: 2vw'>详 >></a>");
                        $("#openPopover8").html(msg.course_sum+" 人 &emsp;"+msg.course_sum_flag);
                        $("#openPopover9").html(msg.evaluate_sum+" 人 &emsp;"+msg.evaluate_sum_flag);
                    }else{
                        swal({
                            title: '',
                            text: data.msg,
                            type: 'error',
                            showConfirmButton:true,
                            timer:3000
                        });
                    }
                }
            });
        })
    })
</script>
{/block}